import request from "@/utils/request.js";


export function ApiLogin (data) {
    return request({
        url: '/v1/user/login',
        method: 'post',
        headers: {'Content-Type': 'application/x-www-form-urlencoded'},
        data: data
    })
}

export function ApiRegister (data) {
    return request({
        url: '/v1/user/register',
        method: 'post',
        data: data
    })
}


export function ApiLogout () {
    return request({
        url: '/v1/user/logout',
        method: 'post',
    })
}

export function ApiCurrentUser () {
    return request({
        url: '/v1/user/current-user',
        method: 'get',
    })
}

export function ApiUpdateUserProfile (data) {
    return request({
        url: '/v1/user/update-profile',
        method: 'post',
        data: data,
    })
}

export function ApiChangePassword (data) {
    return request({
        url: '/v1/user/change-password',
        method: 'put',
        data: data
    })
}
